// combineReducers 是由redux-immutable提供，它只支持immutable对象合并
import { combineReducers } from 'redux-immutable'

import { createStore } from 'redux'



// 导入reducer
import user from './reducers/usesrReducer'
import news from './reducers/newsReducer'

// combineReducers
// 把拆分的reducer合并成一个大的reducer
// 在connect中获取时多一个 命名空间名称,命名空间名称就是此时combineReducers中对象key名称
const reducer = combineReducers({
  user,
  news
})

// 创建仓库
export default createStore(
  reducer,
  window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
)
